﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace EFong.Contract
{
    [DataContract]
    public class Vendor
    {
        private Guid _id = Guid.NewGuid();
        [DataMember]
        public Guid ID
        {
            get { return _id; }
            set { _id = value; }
        }

        private string _name = string.Empty;
        [DataMember]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        private string _nr = string.Empty;
        [DataMember]
        public string Nr
        {
            get { return _nr; }
            set { _nr = value; }
        }

        private List<Project> _projectList = new List<Project>();
        [DataMember]
        public List<Project> ProjectList
        {
            get { return _projectList; }
            set { _projectList = value; }
        }

        private string _address = string.Empty;
        [DataMember]
        public string Address
        {
            get { return _address; }
            set { _address = value; }
        }

        private string _contactPerson1 = string.Empty;
        [DataMember]
        public string ContactPerson1
        {
            get { return _contactPerson1; }
            set { _contactPerson1 = value; }
        }

        private string contactPerson1Tel1 = string.Empty;
        [DataMember]
        public string ContactPerson1Tel1
        {
            get { return contactPerson1Tel1; }
            set { contactPerson1Tel1 = value; }
        }

        private string contactPerson1Tel2 = string.Empty;
        [DataMember]
        public string ContactPerson1Tel2
        {
            get { return contactPerson1Tel2; }
            set { contactPerson1Tel2 = value; }
        }

        private string _contactPerson2 = string.Empty;
        [DataMember]
        public string ContactPerson2
        {
            get { return _contactPerson2; }
            set { _contactPerson2 = value; }
        }

        private string contactPerson2Tel1 = string.Empty;
        [DataMember]
        public string ContactPerson2Tel1
        {
            get { return contactPerson2Tel1; }
            set { contactPerson2Tel1 = value; }
        }

        private string contactPerson2Tel2 = string.Empty;
        [DataMember]
        public string ContactPerson2Tel2
        {
            get { return contactPerson2Tel2; }
            set { contactPerson2Tel2 = value; }
        }

        private string tel1 = string.Empty;
        [DataMember]
        public string Tel1
        {
            get { return tel1; }
            set { tel1 = value; }
        }

        private string tel2 = string.Empty;
        [DataMember]
        public string Tel2
        {
            get { return tel2; }
            set { tel2 = value; }
        }

        private string tel3 = string.Empty;
        [DataMember]
        public string Tel3
        {
            get { return tel3; }
            set { tel3 = value; }
        }

        private string tel4 = string.Empty;
        [DataMember]
        public string Tel4
        {
            get { return tel4; }
            set { tel4 = value; }
        }

        private string tel5 = string.Empty;
        [DataMember]
        public string Tel5
        {
            get { return tel5; }
            set { tel5 = value; }
        }

        private string tel6 = string.Empty;
        [DataMember]
        public string Tel6
        {
            get { return tel6; }
            set { tel6 = value; }
        }

        private string fax1 = string.Empty;
        [DataMember]
        public string Fax1
        {
            get { return fax1; }
            set { fax1 = value; }
        }

        private string fax2 = string.Empty;
        [DataMember]
        public string Fax2
        {
            get { return fax2; }
            set { fax2 = value; }
        }

        private string financial = string.Empty;
        [DataMember]
        public string Financial
        {
            get { return financial; }
            set { financial = value; }
        }

        private string financialTel1 = string.Empty;
        [DataMember]
        public string FinancialTel1
        {
            get { return financialTel1; }
            set { financialTel1 = value; }
        }

        private string financialTel2 = string.Empty;
        [DataMember]
        public string FinancialTel2
        {
            get { return financialTel2; }
            set { financialTel2 = value; }
        }

        private string _remark = string.Empty;
        [DataMember]
        public string Remark
        {
            get { return _remark; }
            set { _remark = value; }
        }

        private bool _effective = true;
        [DataMember]
        public bool Effective
        {
            get { return _effective; }
            set { _effective = value; }
        }

        public override bool Equals(object obj)
        {
            Vendor temp = obj as Vendor;
            if (temp == null)
                return false;
            return (this.ID.Equals(temp.ID));
        }

        public override string ToString()
        {
            return Name;
        }
    }
}
